package threading;

/**
 * @author 徐志荣
 * @date 2023/3/16 14:28
 */
public class ThreadDemo12 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            while (true) {
                //System.out.println("hello t");
            }

        });

        //在启动之前,获取线程状态 NEW
        System.out.println(thread.getState());
        thread.start();

        Thread.sleep(2000);

        System.out.println(thread.getState());
    }
}
